package top.datacluster.basic.niukewang;

public class EmptyBottle {

    public int drink(int n){
        int result = 0;
        while (n >= 3){
            int temp = n / 3;
            n = n % 3;
            result += temp;
            n += temp;
        }
        if (n == 2){
            result++;
        }
        return result;
    }

    public static void main(String[] args) {

            System.out.println(new EmptyBottle().drink(59));
    }
}
